<?php
define('IN_TG','photo');
define('IN_JS',true);
define('SCRIPT','photo');
session_start();
require('includes/common.inc.php');
require('header.php');
//分页
$sql_count = "select count(tg_id) from tg_dir";
$res=_query($sql_count);

$sql = "select tg_id,tg_name,tg_face from tg_dir";
$size = $_system['photo'];
_page($sql,$size);
$sql .= " limit $_pagenum,$size";
$reres = _query($sql);
$arr=array();
while($row = _fetch_array_list($reres)){
    $arr[] = $row;
}
?>
<div id="photo">
	<h2>相册列表</h2>
	<?php if(!empty($arr)):?>
        <?php  foreach($arr as $value):?>
		<dl>
		<dt><a href="photo_show.php?id=<?php  echo $value['tg_id'];?>"><img src="<?php  echo $value['tg_face'];?>" width="70" height="70"> </a></dt>
		<dd><a href="photo_show.php?id=<?php  echo $value['tg_id'];?>"><?php echo $value['tg_name'];?></a></dd>
        </dl>
        <?php  endforeach;?>
    <div id="page_num"><?php _paging(1);?></div>
	<?php else:?>
		<p align="center"><strong>暂无相册</strong></p>
	<?php endif;?>
	<p><a href="photo_add_dir.php">增加相册</a></p>
	</div>
<?php if (isset($_COOKIE['username'])): ?>
<?php
endif;
require('includes/footer.inc.php');
?>